<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="<?php echo base_url() . 'style/admin/css/public.css' ?>">
    <script type="text/javascript" src="<?php echo base_url() ?>org/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript">
        window.UEDITOR_HOME_URL = "<?php echo base_url() ?>org/ueditor/";
        window.onload = function(){
            window.UEDITOR_CONFIG.initialFrameWidth = 800;
            window.UEDITOR_CONFIG.initialFrameHeight = 400;
            UE.getEditor('content');
        }
    </script>
    <script type="text/javascript" src="<?php echo base_url() ?>org/ueditor/ueditor.config.js"></script>
    <title>Document</title>
    <style type="text/css">
        span{
            color: #f00;
        }
        td span {text-align: center;padding-left: 30px;}
        #cid {
            padding: 0 10px;
        }
    </style>
</head>
<body>
<form action="<?php echo site_url('admin/article/runAddArticle') ?>" method="POST" enctype="multipart/form-data">
    <table class="table">
        <tr>
            <td class="th" colspan="10">发表文章<?php echo $error; ?></td>
        </tr>
        <tr>
            <td>标题</td>
            <td><input type="text" name="title" value="<?php echo set_value('title') ?>"/>
                <?php echo form_error('title', '<span>', '</span>') ?>
            </td>
        </tr>
        <tr>
            <td>类型</td>
            <td>
                <input type="radio" name="type" value="0"<?php echo set_radio('type', '0', TRUE) ?>/> 普通
                <input type="radio" name="type" value="1"<?php echo set_radio('type' ,'1') ?>/> 热门
                <span><?php echo form_error('type') ?></span>
            </td>
        </tr>
        <tr>
            <td>栏目</td>
            <td>
                <select name="cid" id="cid">
                    <?php foreach($cate as $item): ?>
                        <option value="<?php echo $item['cid'] ?>"<?php echo set_select('cid', $item['cid']) ?>><?php echo $item['cname'] ?></option>
                    <?php endforeach ?>
                </select>
                <span><?php echo form_error('cid') ?></span>
            </td>
        </tr>
        <tr>
            <td>缩略图</td>
            <td>
                <input type="file" name="thumb"/>
            </td>
        </tr>
        <tr>
            <td>摘要</td>
            <td>
                <textarea name="info" id="info" style="width:550px;height:160px;"><?php echo set_value('info') ?></textarea>
                <?php echo form_error('info', '<span>', '</span>') ?>
            </td>
        </tr>
        <tr>
            <td>内容</td>
            <td>
                <textarea name="content" id="content" style="width:600px;height:400px;"><?php echo set_value('content') ?></textarea>
                <?php echo form_error('content', '<span>', '</span>') ?>
            </td>
        </tr>
        <tr>
            <td colspan="10"><input type="submit" class="input_button" value="发布"/></td>
        </tr>
    </table>
</form>
</body>
</html>